from django.http import JsonResponse
from django.core.serializers.json import DjangoJSONEncoder

class JsonResult(JsonResponse):
    '''
    :param code: 0处理成功 -1失败
    :param msg:  提示消息
    :param data: 返回的数据
    :return: 返给前台的json
    '''
    def __init__(self, code=-1, msg="", data=None, **kwargs):
        data = {"code": code, "msg": msg, "data": data}
        super(JsonResult,self).__init__(data, safe=True,json_dumps_params=None, **kwargs)
